package com.book.common.task;

import com.book.book.storage.AbstractNovelStorage;
import com.book.book.storage.BXWX9NovelStorageImpl;
import com.book.book.storage.KSZNovelStorageImpl;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.io.FileNotFoundException;

/***
 * @Author Lin
 * @Date Create By 20:48 2017/10/9
 * @Description
 */
@Component("novelSpiderTask")
public class NovelSpiderTask {

    @Scheduled(cron = "0 0 23 * * ? ")
    public void NovelSpider() throws FileNotFoundException {
        AbstractNovelStorage spider = new KSZNovelStorageImpl();
        spider.process();

        spider = new BXWX9NovelStorageImpl();
        spider.process();

        //System.out.println("任务进行中。。。");
    }
}
